// virtual function
#include <iostream>
using namespace std;

class Car 
{
    public:
        virtual void changeGear() {cout << "full speed" << endl;}
};

class SportsCar:public Car
{
    public:
        void changeGear() {cout << "more full speed xD" << endl;} // Method Overriding
        void f2() {}
};

int main()
{
    Car *p, o1;
    SportsCar o2;
    p = &o2;
    // p->changeGear(); // without virtual: Car's changeGear
    p->changeGear(); // with virtual: SportCar's changeGear // late binding
}

/*
https://i.imgur.com/3su9LNZ.png
https://i.imgur.com/qhKd5tM.png
*/